package com.example.controller;

import com.example.Repository.LikeRepository;
import com.example.pojo.Result;
import com.example.pojo.dto.LikeDto;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author crt
 */
@RestController
@RequestMapping("like")
public class LikeController {

    @Resource
    LikeRepository likeRepository;

    @PostMapping("/trendsLike")
    public Result<String> trendsLike(@Valid @RequestBody LikeDto likeDto){

        return likeRepository.trendsLike(likeDto);
    }

    @PostMapping("/commentLike")
    public Result<String> commentLike(@Valid @RequestBody List<LikeDto> likeDtoList){

        return likeRepository.commentLike(likeDtoList);
    }

}
